home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
tex
/
do30.zip
/
DO.DOC
< prev
next >
Wrap
Text File
|
1987-10-08
|
25KB
|
475 lines
┌-DO (v3) $10 TO LARRIE HUTTON 701 WARREN ST, MARIETTA, OH 45750 614-374-8337-┐
│ (s) Strip LF to CR/LF or (x)-out LFs. (p) Paragraph or (o)ne-line lines. │
│ (w) WordStar from ASCII. (h) High bits out [WS to ASCII]. │
│ (u) Upper or (l)ower case only. (q) Quicksort [2048 lins / 127 chr]. │
│ (n) Number lines; no trailing spaces. (b) Bomb repeated & blank lines. │
│ (e) Expand tabs with spaces. (t) Tag lines within range. │
│ (c) Copy lines between two columns. (i) Insert, at column, a string. │
│ (f) Find or (r)eplace string. (a) Ask before replacing. │
│ (j) Join or (m)erge-alpha two files. (g) Glue two files side by side. │
│ (k) Change all letters but 1st to low. (d) Makes "Tom Mix,OH" "Mix,Tom,OH" │
├-----------------------------------------------------------------------------┤
│ NOTES on find, replace, and ask: Upper case (F,R,A) causes commands to │
│ ignore case. ASCII values entered with #nnn#; eg, #13##10# is CR/LF. │
├-----------------------------------------------------------------------------┤
│ COMMAND LINE EXAMPLES (where: i=input l=line c=col s=string #n#=ascii) │
├-----------------------------------------------------------------------------┤
│ do s i do p d:\dir\i do w i > d:\dir\o do h i │
│ do u i do q con: c c s do n i > prn do b con: > prn │
│ do e i c do t i +/-l +/-l do c i c c do i i c s s s │
│ do r i s // s do a i s#n#s // s do j i i +/-l do g i i │
├-----------------------------------------------------------------------------┤
│Choose from above (or "?" for cmnd ln sntx, "+" for 9 lns, "-" for 4 lns): │
│ │
│ │
└-----------------------------------------------------------------------------┘
D O . D O C
Larrie V. Hutton
701 Warren Street
Marietta, OH 45750
(614) 374-8337
This is admittedly pretty sparse documentation for a fairly complicated
program--the DO text file manipulator. I had hoped the program screen
would be self-explanatory. It wasn't, so here goes. The manual enclosed
here (to use the term loosely) is divided into three small sections: [1] a
BRIEF description of most of the less obvious commands, [2] a section
providing some details of the screen and command line formats with a few
sample batch file suggestions, and [3] a listing of the comments in the
source code. The latter is included because some of you may find it
helpful to see the internal documentation, but I am not going to elaborate
(I have a job!). Incidentally, the last section was produced easily by
using DO to search for all lines with an asterisk.
INDIVIDUAL COMMANDS
(s) Strips LF's (ASCII 10) or CR's (ASCII 13) and replaces them with
a CR/LF combination. Useful for files that overwrite lines (have
only CR's) or begin just below the end of the previous line (have
only LF's).
(x) Rubs out LF's and leaves only CR's. Useful for uploading to UNIX
editors, for example, that count both CR's and LF's as valid line
terminators. Without this ability, files are often double spaced
when they should not be.
(p) Paragraphs are formed from single lines by replacing CR/LF
combinations with spaces; joins consecutive lines. Good for
putting ASCII text into form suitable for most word processors.
A CR/LF combination IS issued, however, for blank lines--in fact,
two CR/LF combinations are issued at blank lines to preserve the
"original intent".
(o) One-lines paragraphs--the previous command in reverse. Useful
for taking long text strings and turning them into proper ASCII
format. Lines are formed at the next word break whenever the
number of characters exceeds 60.
(w) WordStar from ASCII. Not perfect, but does a pretty good job at
guessing, and much easier than hand-editing an ASCII file from
scratch.
(h) Reverse of the previous, but much easier to implement. Simply
replaces all high bits with low, so produces proper ASCII text.
Useful for peeking at a WS file.
(u) Upper case text only produced.
(l) Lower case text only produced.
(q) Really a merge sort for text, and a shell sort for numbers. Very
fast and flexible. Maximum number of lines shows on screen;
since routine uses the heap, the maximum file size is dependent
upon available RAM.
(n) Numbers lines (default is to use first eight columns for this
information). Also removes trailing blanks from all lines.
Sometimes the latter function is really what is needed; in that
case, number the lines and copy only from the ninth column and
beyond with the (c) option. Blank lines are counted, but the
numbers aren't printed.
(b) Bombs (deletes) all blank lines and duplicate lines. Sometimes
useful after sorting.
(e) Expands tabs with tabs. Default is eight spaces.
(t) Tags lines: Lets you copy lines 37-94 only, for example.
Entering -5 to -1 would produce the LAST 5 lines.
(c) Copies only text that falls within the specified columns. If the
end column is not specified, assumes to end. If end column is
negative, pads with spaces if necessary to assure that all lines
are same length.
(i) Inserts a string at any given column position. Could be used,
for example, to widen borders. If a CR/LF is inserted (with
#13##10#), causes lines to be split at that point into two lines.
(f) Finds strings in text. Again, can look for any ASCII string by
using #n# combinations. Upper case F causes case to be ignored.
(r) Similar, but replaces all instances of one string with another.
Can also be used to produce output that has only lines containing
the string, or all lines NOT containing the string (by using
"????" or "!!!!" as the replacement string. On the command line,
a double slash (//), with a space on each side, should separate
the old and new strings. Again, ASCII values can be entered
directly. An R causes case to be ignored.
(a) Asks before replacing. Lets you see the line with and without
the replacement before you decide.
(j) Joins two files by letting you insert the second file at any line
in the first.
(m) Merges two files alphabetically. In other words, if you have two
sorted files, this will create a single sorted file. Since there
is no limit on file size, this would permit files too large to be
(q)uick sorted to be split into two (or many) files, sorted with
(q), and then merged.
(g) Glues two files side-by-side. Most useful if the first file has
been padded with spaces to a consistent line length with the (c)
command.
(k) Change all letters but first letter in word to lower case; first
letter is capitalized. Two common uses would be to take a
mailing list with all caps and turn it into a more respectable-
looking file, or to clean up inconsistently formatted source
code.
(d) Takes the last word in the first field of a comma-delimited data
file and creates a new, first field. For example, mailing lists
that don't separate the last and first names with a comma (and
t